// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file camera_capture.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "camera_capture.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>


camera_capture::camera_capture()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1d8d30f7
    m_timestamp_ = 0;
    // m_timestamp_utc_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3e57cd70
    m_timestamp_utc_ = 0;
    // m_seq_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9a7504c
    m_seq_ = 0;
    // m_lat_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2c039ac6
    m_lat_ = 0.0;
    // m_lon_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@587d1d39
    m_lon_ = 0.0;
    // m_alt_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@58c1670b
    m_alt_ = 0.0;
    // m_ground_distance_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6b57696f
    m_ground_distance_ = 0.0;
    // m_q com.eprosima.idl.parser.typecode.AliasTypeCode@6b9651f3
    memset(&m_q, 0, (4) * 4);
    // m_result_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@687080dc
    m_result_ = 0;

}

camera_capture::~camera_capture()
{









}

camera_capture::camera_capture(const camera_capture &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_ground_distance_ = x.m_ground_distance_;
    m_q = x.m_q;
    m_result_ = x.m_result_;
}

camera_capture::camera_capture(camera_capture &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_ground_distance_ = x.m_ground_distance_;
    m_q = std::move(x.m_q);
    m_result_ = x.m_result_;
}

camera_capture& camera_capture::operator=(const camera_capture &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_ground_distance_ = x.m_ground_distance_;
    m_q = x.m_q;
    m_result_ = x.m_result_;

    return *this;
}

camera_capture& camera_capture::operator=(camera_capture &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_timestamp_utc_ = x.m_timestamp_utc_;
    m_seq_ = x.m_seq_;
    m_lat_ = x.m_lat_;
    m_lon_ = x.m_lon_;
    m_alt_ = x.m_alt_;
    m_ground_distance_ = x.m_ground_distance_;
    m_q = std::move(x.m_q);
    m_result_ = x.m_result_;

    return *this;
}

size_t camera_capture::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += ((4) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

size_t camera_capture::getCdrSerializedSize(const camera_capture& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    if ((4) > 0)
    {
        current_alignment += ((4) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
    }

    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);



    return current_alignment - initial_alignment;
}

void camera_capture::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_timestamp_utc_;
    scdr << m_seq_;
    scdr << m_lat_;
    scdr << m_lon_;
    scdr << m_alt_;
    scdr << m_ground_distance_;
    scdr << m_q;

    scdr << m_result_;
}

void camera_capture::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_timestamp_utc_;
    dcdr >> m_seq_;
    dcdr >> m_lat_;
    dcdr >> m_lon_;
    dcdr >> m_alt_;
    dcdr >> m_ground_distance_;
    dcdr >> m_q;

    dcdr >> m_result_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void camera_capture::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t camera_capture::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& camera_capture::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member timestamp_utc_
 * @param _timestamp_utc_ New value for member timestamp_utc_
 */
void camera_capture::timestamp_utc_(uint64_t _timestamp_utc_)
{
m_timestamp_utc_ = _timestamp_utc_;
}

/*!
 * @brief This function returns the value of member timestamp_utc_
 * @return Value of member timestamp_utc_
 */
uint64_t camera_capture::timestamp_utc_() const
{
    return m_timestamp_utc_;
}

/*!
 * @brief This function returns a reference to member timestamp_utc_
 * @return Reference to member timestamp_utc_
 */
uint64_t& camera_capture::timestamp_utc_()
{
    return m_timestamp_utc_;
}

/*!
 * @brief This function sets a value in member seq_
 * @param _seq_ New value for member seq_
 */
void camera_capture::seq_(uint32_t _seq_)
{
m_seq_ = _seq_;
}

/*!
 * @brief This function returns the value of member seq_
 * @return Value of member seq_
 */
uint32_t camera_capture::seq_() const
{
    return m_seq_;
}

/*!
 * @brief This function returns a reference to member seq_
 * @return Reference to member seq_
 */
uint32_t& camera_capture::seq_()
{
    return m_seq_;
}

/*!
 * @brief This function sets a value in member lat_
 * @param _lat_ New value for member lat_
 */
void camera_capture::lat_(double _lat_)
{
m_lat_ = _lat_;
}

/*!
 * @brief This function returns the value of member lat_
 * @return Value of member lat_
 */
double camera_capture::lat_() const
{
    return m_lat_;
}

/*!
 * @brief This function returns a reference to member lat_
 * @return Reference to member lat_
 */
double& camera_capture::lat_()
{
    return m_lat_;
}

/*!
 * @brief This function sets a value in member lon_
 * @param _lon_ New value for member lon_
 */
void camera_capture::lon_(double _lon_)
{
m_lon_ = _lon_;
}

/*!
 * @brief This function returns the value of member lon_
 * @return Value of member lon_
 */
double camera_capture::lon_() const
{
    return m_lon_;
}

/*!
 * @brief This function returns a reference to member lon_
 * @return Reference to member lon_
 */
double& camera_capture::lon_()
{
    return m_lon_;
}

/*!
 * @brief This function sets a value in member alt_
 * @param _alt_ New value for member alt_
 */
void camera_capture::alt_(float _alt_)
{
m_alt_ = _alt_;
}

/*!
 * @brief This function returns the value of member alt_
 * @return Value of member alt_
 */
float camera_capture::alt_() const
{
    return m_alt_;
}

/*!
 * @brief This function returns a reference to member alt_
 * @return Reference to member alt_
 */
float& camera_capture::alt_()
{
    return m_alt_;
}

/*!
 * @brief This function sets a value in member ground_distance_
 * @param _ground_distance_ New value for member ground_distance_
 */
void camera_capture::ground_distance_(float _ground_distance_)
{
m_ground_distance_ = _ground_distance_;
}

/*!
 * @brief This function returns the value of member ground_distance_
 * @return Value of member ground_distance_
 */
float camera_capture::ground_distance_() const
{
    return m_ground_distance_;
}

/*!
 * @brief This function returns a reference to member ground_distance_
 * @return Reference to member ground_distance_
 */
float& camera_capture::ground_distance_()
{
    return m_ground_distance_;
}

/*!
 * @brief This function copies the value in member q
 * @param _q New value to be copied in member q
 */
void camera_capture::q(const camera_capture__float_array_4 &_q)
{
m_q = _q;
}

/*!
 * @brief This function moves the value in member q
 * @param _q New value to be moved in member q
 */
void camera_capture::q(camera_capture__float_array_4 &&_q)
{
m_q = std::move(_q);
}

/*!
 * @brief This function returns a constant reference to member q
 * @return Constant reference to member q
 */
const camera_capture__float_array_4& camera_capture::q() const
{
    return m_q;
}

/*!
 * @brief This function returns a reference to member q
 * @return Reference to member q
 */
camera_capture__float_array_4& camera_capture::q()
{
    return m_q;
}
/*!
 * @brief This function sets a value in member result_
 * @param _result_ New value for member result_
 */
void camera_capture::result_(uint8_t _result_)
{
m_result_ = _result_;
}

/*!
 * @brief This function returns the value of member result_
 * @return Value of member result_
 */
uint8_t camera_capture::result_() const
{
    return m_result_;
}

/*!
 * @brief This function returns a reference to member result_
 * @return Reference to member result_
 */
uint8_t& camera_capture::result_()
{
    return m_result_;
}


size_t camera_capture::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;












    return current_align;
}

bool camera_capture::isKeyDefined()
{
   return false;
}

void camera_capture::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
     
}
